package cn.turing.firecontrol.device.entity;

import java.lang.annotation.*;
import java.util.Date;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.Pattern;

/**
 * @auther Wyt
 * @date 2023/4/7/007 10:13
 */
@Table(name = "device_sensor")
public class DeviceSensorDo {
    @ExcelColumn("设备id")
    private Long id;

    //建筑列表id
    @ExcelColumn("建筑id")
    private Integer buildingId;

    //栏目id
    @ExcelColumn("栏目id")
//	@NotNull(message = "栏目ID不能为空")
    private Integer channelId;

    //传感器编号
    @Length(max = 16,min = 1,message = "设备编号长度最大16个字符")
    @Pattern(regexp = "^[A-Za-z0-9:]+$",message = "设备编号只允许字母与数字")
    @NotBlank(message = "设备编号不能为空")
    @Column(name = "SENSOR_NO")
    @ExcelColumn("传感器编号")
    private String sensorNo;

    //楼层
    @Column(name = "FLOOR")
    @ExcelColumn("所属楼层")
    private Integer floor;

    //位置描述
    @Column(name = "POSITION_DESCRIPTION")
    @ExcelColumn("所在位置")
    private String positionDescription;



    //设备类型
    @Transient
    @ExcelColumn("设备类型")
    private String equipmentType;

    //厂商
    @Transient
    @ExcelColumn("厂商")
    private String manufacturer;

    //型号
    @Transient
    @ExcelColumn("型号")
    private String model;



    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getBuildingId() {
        return buildingId;
    }

    public void setBuildingId(Integer buildingId) {
        this.buildingId = buildingId;
    }

    public Integer getChannelId() {
        return channelId;
    }

    public void setChannelId(Integer channelId) {
        this.channelId = channelId;
    }

    public String getSensorNo() {
        return sensorNo;
    }

    public void setSensorNo(String sensorNo) {
        this.sensorNo = sensorNo;
    }

    public Integer getFloor() {
        return floor;
    }

    public void setFloor(Integer floor) {
        this.floor = floor;
    }

    public String getPositionDescription() {
        return positionDescription;
    }

    public void setPositionDescription(String positionDescription) {
        this.positionDescription = positionDescription;
    }



    public String getEquipmentType() {
        return equipmentType;
    }

    public void setEquipmentType(String equipmentType) {
        this.equipmentType = equipmentType;
    }

    public String getManufacturer() {
        return manufacturer;
    }

    public void setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }



    @Override
    public String toString() {
        return "DeviceSensorDo{" +
                "id=" + id +
                ", buildingId=" + buildingId +
                ", channelId=" + channelId +
                ", sensorNo='" + sensorNo + '\'' +
                ", floor=" + floor +
                ", positionDescription='" + positionDescription + '\'' +
                ", equipmentType='" + equipmentType + '\'' +
                ", manufacturer='" + manufacturer + '\'' +
                ", model='" + model + '\'' +
                '}';
    }
}
